from IPython.display import Javascript, display
from ipywidgets import widgets
def run_all(ev):
display(Javascript('IPython.notebook.execute_cells_below()'))
button = widgets.Button(description="Click here to update tables + charts:")
button.on_click(run_all)
display(button)
import pandas as pd
import numpy as np
import sqlalchemy as sa
import glob
import os
import sys
import matplotlib.pyplot as plt
import matplotlib.pylab as pylab
import plotly.plotly as py
from plotly.graph_objs import *
import datetime
%matplotlib inline
#%pylab inline
pylab.rcParams['figure.figsize'] = (15, 25)
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
import qgrid
qgrid.nbinstall(overwrite=True)
engine = sa.create_engine('mysql+pymysql://root:@localhost/rsi?charset=utf8')
conn = engine.connect()
#updates process table in db and creates process df
df = pd.read_excel("//SERVER01/Public/ProcessingData_6in_R&DLine.xlsx", header=0)
df.to_sql('process', conn, if_exists='replace', index = True, index_label='process_index')
#del processdf
processdf = df
#qgrid.show_grid(processdf)
#update once a week
process_df_list = []
p = "//SERVER01/Public/Processing Data and Experiment Logs Archives and Backup/ProcessingData_6in_R&DLine_*.xlsx"
processFiles = glob.glob(p)
for i,f in enumerate(processFiles):
sys.stdout.write('\r')
sys.stdout.write(str(i))
sys.stdout.flush()
df_1 = pd.read_excel(f, header = 0)
process_df_list.append(df_1)
process_df_list = pd.concat(process_df_list)
oldp = pd.DataFrame(process_df_list)
oldp1 = oldp.reindex_axis(df.columns, axis=1)
#del processdf
fprocessdf = pd.concat([oldp1, df])
fprocessdf
fprocessdf.to_sql('fullprocess', conn, if_exists='replace', index = True, index_label='fullprocess_index')
#creates expdf
df2 = pd.read_excel("//SERVER01/Public/ExperimentLog.xlsx", header=0, parse_cols=[0,1,2,3,4,5,6,8])
#df2.dropna(axis=1, how='all') #remove na col
#df2["Experiment_ID"] = df2["Experiment_ID"].str.replace("Exp_","").astype(float)
#df2["Experiment_ID"] = df2["Experiment_ID"].str.replace("EXP_","").astype(float)
df2['Experiment_ID'] = df2['Experiment_ID'].str.replace("Exp_","")
df2['Experiment_ID'] = df2['Experiment_ID'].str.replace("EXP_","")
df2['Experiment_ID'] = df2['Experiment_ID'].astype(float)
#del expdf
expdf = df2
#def mask(df, f):
# return df[f(df)]
#def mask(df, key, value):
# return df[df[key] == value]
#df.mask('A', 1).mask('D', 6)
#add POR or EXP classification
expdf['POR'] = 'EXP'
mask1 = expdf.Split1.str.contains('.*POR.*', na=False)
expdf.loc[:,'POR'][mask1] = 'POR'
#expdf.mask('POR',)
mask2 = expdf.Split2.str.contains('.*POR.*', na=False)
expdf.loc[:,'POR'][mask2] = 'POR'
mask3 = expdf.Split3.str.contains('.*POR.*', na=False)
expdf.loc[:,'POR'][mask3] = 'POR'
mask4 = expdf.Description.str.contains('.*POR.*', na=False)
expdf.loc[:,'POR'][mask4] = 'POR'
#updates exp log in db
expdf.to_sql('exp', conn, if_exists='replace', index = True, index_label='exp_index')
expdf.head()
#expdf.dtypes
#push to sql once a wk
e = pd.read_excel("//SERVER01/Public/Processing Data and Experiment Logs Archives and Backup/ExperimentLog - Jun05.xlsx", header=0, parse_cols=[0,1,2,4,5,6,7])
e1 = e.reindex_axis(df2.columns, axis=1)
e1['Experiment_ID'] = e1['Experiment_ID'].str.replace("Exp_","")
e1['Experiment_ID'] = e1['Experiment_ID'].str.replace("EXP_","")
e1['Experiment_ID'] = e1['Experiment_ID'].str.replace("exp_","")
e1['Experiment_ID'] = e1['Experiment_ID'].astype(float)
#add POR or EXP classification
e1['POR'] = 'EXP'
mask1 = e1.Split1.str.contains('.*POR.*', na=False)
e1.loc[:,'POR'][mask1] = 'POR'
mask2 = e1.Split2.str.contains('.*POR.*', na=False)
e1.loc[:,'POR'][mask2] = 'POR'
mask3 = e1.Split3.str.contains('.*POR.*', na=False)
e1.loc[:,'POR'][mask3] = 'POR'
mask4 = e1.Description.str.contains('.*POR.*', na=False)
e1.loc[:,'POR'][mask4] = 'POR'
fullexpdf = pd.concat([e1, expdf])
fullexpdf.to_sql('fullexp', conn, if_exists='replace', index = True, index_label='fexp_index')
fullexpdf.head()
#updates ED log table in db
#ED_data_list = []
#efiles = \\6in-cdte1\Users\reelsolar\Documents\CdTe Log Data\*.xls
#(time, soln temp, chuck temp(deprecated), flow rate, side + pin currents)
#e1files = \\6in-cdte1\Users\reelsolar\Documents\CdTe Log Data\*P.xls
#(time, soln temp, flow rate, pin currents)
#EDFiles = allFiles = glob.glob("//ED3-pc/Users/ReelSolar/Documents/CdTe Log Data/*.xls")
#for i,f in enumerate(allFiles):
# sys.stdout.write('\r')
# sys.stdout.write(str(i))
# sys.stdout.flush()
# df4 = pd.read_excel(f, sep='\t', header = 0, skiprow=1)
# ED_data_list.append(df4)
#ED_data_list = pd.concat(ED_data_list)
#filename as index,
#print('Done.')
#ED info
ed = pd.read_csv("//SERVER01/Public/SPC/Database/ED.csv", header=0, skip_blank_lines=True)
ed.to_sql('ed', conn, if_exists='replace', index = True, index_label='ed_index')
print('Done.')
#XRF info
xrf = pd.read_csv("//SERVER01/Public/SPC/Database/XRF.csv", header=0, skip_blank_lines=True)
xrf.to_sql('xrf', conn, if_exists='replace', index = True, index_label='xrf_index')
print('Done.')
#updates sencera log table in db and creates senceradf
p1 = "//SERVER01/Public/Process Modules/08 - Sputter/Sencera MoNAl Process Monitor.xlsx"
df5 = pd.read_excel(p1, header=0, parse_cols=[0,1,2,3,9,10,11,12,13,16,17,18,19,20,22,23,24,26,27])
df5.to_sql('sencera', conn, if_exists='replace', index = True, index_label='sencera_index')
#sencera = df5[df5['Date_tm'].apply(lambda x: type(x)==datetime.datetime)==True]
sencera = df5
sencera.tail()
print('Done.')
#updates IVT data to send to db
#----------append routine, only use if # of cols vary between ivt files. if not, concat -------#
#path =r"//rsi-ivt-pc/Users/Reel Solar/IV curves/" can use below instead of full path, path + ""
#df3 = pd.concat(pd.read_csv(f) for f in allFiles)
#len(allFiles) 10876 02/22/16
#IVT_data = pd.DataFrame()
#for i,f in enumerate(allFiles):
# sys.stdout.write('\r')
# sys.stdout.write(str(i))
# sys.stdout.flush()
# df3 = pd.read_csv(f, sep='\t', header = 0)
# IVT_data = IVT_data.append(df3, ignore_index=True)
IVT_data_list = []
allFiles = glob.glob("//rsi-ivt-pc/Users/Reel Solar/IV curves/*fit_parameters.txt")
for i,f in enumerate(allFiles):
sys.stdout.write('\r')
sys.stdout.write(str(i))
sys.stdout.flush()
df3_2 = pd.read_csv(f, sep='\t', header = 0, parse_dates=['Date_tm'])
IVT_data_list.append(df3_2)
#IVT_data3 = pd.concat(IVT_data_list, ignore_index=True)
%time IVT_data_list = pd.concat(IVT_data_list)
print('Done.')
#modifies ivtdf, sets datetime info
ivtdf = IVT_data_list.drop('n', 1) #remove null and inf cols
ivtdf = IVT_data_list.drop('IO_nA', 1)
ivtdf = ivtdf.drop('fit_check', 1)
ivtdf = ivtdf.drop('fit_res_var',1)
#panda i/o to sql has problems with inf values, routine below replaces these with nan ==> None in SQL:
#ivtdf = ivtdf.where(pd.notnull(ivtdf), None)
ivtdf = ivtdf.replace([np.inf, -np.inf], np.nan)
ivtdf = ivtdf[ivtdf['Date_tm'].apply(lambda x: type(x)==datetime.datetime)==True]
ivtdf = ivtdf[~ivtdf['Sample_ID'].str.contains('.*PHILIP.*', na = False)]
ivtdf['Rsh_Ohm'] = ivtdf['Rsh_Ohm'].astype(float)
#ivtdf['Rsh'] = ivtdf['Rsh_Ohm']/ivtdf['Cell_Count'] fix gives inf
#def shunt(row):
# if row['Rsh'] <=50.0:
# return 1
#ivtdf['shunt_count'] = ivtdf.apply(lambda row: shunt(row), axis=1)
ivtdf.info() #confirm removal/ replacement
#sends ivt data to sql db
%time ivtdf.to_sql('ivt', conn, if_exists='replace', index = True, index_label='ivt_index')
print('Done.')
#creates ivtdfmod and module trends dfs
ivtdfmod = pd.DataFrame(ivtdf[ivtdf.Cell_Count > 19])
#list(ivtdfmod.columns.values)
#del mod_trends
ivtdfmod['Rsh_Ohm'] = ivtdfmod['Rsh_Ohm'].astype(float)
mod_trends = pd.merge(left=expdf, right=ivtdfmod, left_on='Sample ID', right_on='Sample_ID')
mod_trends.sort_values(by='Experiment_ID')
mod_trends = mod_trends.replace([np.inf, -np.inf], np.nan)
mod_trends['percentEff'] = mod_trends['Efficiency']*100
mod_trends['percentFF'] = mod_trends['FillFactor']*100
mod_trends['modVoc'] = mod_trends['Voc_V']/mod_trends['Cell_Count']
mod_trends['modJsc'] = (mod_trends['Isc_mA']/mod_trends['Cell_Area_mm2'])*100
mod_trends['modRs'] = mod_trends['Roc_Ohm']/mod_trends['Cell_Count']
mod_trends['modRsh'] = mod_trends['Rsc_Ohm']/mod_trends['Cell_Count']
def mod_shunt(row):
if row['modRsh'] <=50.:
return 1
mod_trends['shunt_count'] = mod_trends.apply(lambda row: mod_shunt(row), axis=1)
#mod_trends.sort_values(by='Date (IVT Measure)')
mod_trends = mod_trends.replace([np.inf, -np.inf], np.nan)
mod_trends.head() #confirms accurate mod measurements
#creates cell trends df
#del cell_trends
ivtdfcell = pd.DataFrame(ivtdf[ivtdf.Cell_Count == 1 ])
ivtdfcell['Rsh_Ohm'] = ivtdfcell['Rsh_Ohm'].astype(float)
cell_trends = pd.merge(left=expdf, right=ivtdfcell, left_on='Sample ID', right_on='Sample_ID')
#trends.sort_values(by='POR')
cell_trends.sort_values(by='Date_tm')
#trends.tail(50)
cell_trends['percentEff'] = cell_trends['Efficiency']*100
cell_trends['percentFF']= cell_trends['FillFactor']*100
cell_trends['cellVoc'] = cell_trends['Voc_V']/cell_trends['Cell_Count']
cell_trends['cellJsc']= (cell_trends['Isc_mA']/cell_trends['Cell_Area_mm2'])*100
cell_trends['cellRs'] = cell_trends['Rs_Ohm']/cell_trends['Cell_Count']
cell_trends['cellRs_norm'] = (cell_trends['Rs_Ohm']/cell_trends['Cell_Count'])*(cell_trends['Cell_Area_mm2']/100)
cell_trends['cellRsh'] = cell_trends['Rsc_Ohm']/cell_trends['Cell_Count']
cell_trends['cellRsh_norm'] = (cell_trends['Rsc_Ohm']/cell_trends['Cell_Count'])*(cell_trends['Cell_Area_mm2']/100)
#for i in len(cell_trends['cellRs']):
# if mask1 = expdf.Split1.str.contains('.*POR.*', na=False):
# expdf.loc[:,'POR'][mask1] = 'POR'
# else:
def cell_shunt(row):
if row['cellRsh'] <=50.:
return 1
cell_trends['shunt_count'] = cell_trends.apply(lambda row: cell_shunt(row), axis=1)
cell_trends = cell_trends.replace([np.inf, -np.inf], np.nan)
cell_trends.tail()
#list(cell_trends.columns.values)
#creates trends df = ivtdf + expdf + processdf
#del trends
trends = pd.merge(pd.merge(expdf, processdf), ivtdf, left_on='Sample ID', right_on='Sample_ID')
trends['percentEff'] = trends['Efficiency']*100
trends['percentFF'] = trends['FillFactor']*100
trends['Voc'] = trends['Voc_V']/trends['Cell_Count']
trends['Jsc'] = (trends['Isc_mA']/trends['Cell_Area_mm2'])*100
trends['Rs'] = trends['Roc_Ohm']/trends['Cell_Count']
trends['Rsh'] = trends['Rsc_Ohm']/trends['Cell_Count']
trends['CdS Thickness (nm)'][trends['CdS Thickness (nm)'] == ''] = None
trends['CdS Thickness (nm)'][trends['CdS Thickness (nm)'] == ' '] = None
trends['CdS Thickness (nm)'][trends['CdS Thickness (nm)'] == '?'] = None
trends['CdS Thickness (nm)'] = trends['CdS Thickness (nm)'].astype(float)
trends['CdTe Thickness in Angstroms'][trends['CdTe Thickness in Angstroms'] == ''] = None
trends['CdTe Thickness in Angstroms'][trends['CdTe Thickness in Angstroms'] == ' '] = None
trends['CdTe Thickness in Angstroms'] = trends['CdTe Thickness in Angstroms'].astype(float)
trends = trends.replace([np.inf, -np.inf], np.nan)
#trends.to_sql('trends', conn, if_exists='replace', index = True, index_label='trends_index')
#trends.tail()
#cds thickness trends
#del cds
#df = df.apply(lambda x: x.str.strip()).replace('', np.nan)
#cds = trends[pd.notnull(trends['CdS Thickness (nm)'])]
#cds = cds.apply(lambda x: x.str.strip()).replace('?', np.nan)
cds = pd.DataFrame(trends[trends.Cell_Count >= 22])
cds = cds[~cds['Measurement'].str.contains('.*Dark.*', na = False)]
cds = cds.replace([np.inf, -np.inf], np.nan)
cds = pd.merge(cds, xrf, left_on='Sample ID', right_on='Sample')
cds['CdTe_Tool'] = '1'
mask1 = cds["CdTe 2 Tool"].str.contains('.*TANK.*', na=False)
cds.loc[:,'CdTe_Tool'][mask1] = '2'
#cds.tail(20)
#from IPython.display import display
#grid = qgrid.QGridWidget(df=cds)
#display(grid)
qgrid.show_grid(cds, show_toolbar=True, grid_options={'forceFitColumns': False, 'defaultColumnWidth': 150})
#particulate data
f = '//rsi-ivt-pc/Users/Reel Solar/Desktop//Particulate Analysis.xlsx'
p = pd.read_excel(f, 'Sheet1')
p.info()
p.to_sql('particle', conn, if_exists='replace', index = True, index_label='particle_index')
#SQL trend outs
cell_trends.to_sql('cells', conn, if_exists='replace', index = True, index_label='cells_index')
mod_trends.to_sql('mods', conn, if_exists='replace', index = True, index_label='mods_index')
trends.to_sql('trends', conn, if_exists='replace', index = True, index_label='trends_index')
cds.to_sql('cds', conn, if_exists='replace', index = True, index_label='cds_index')
import time
now = time.strftime("%c")
print ("Updated at: %s" % now )
#exports full trends df to excel
from xlsxwriter.utility import xl_rowcol_to_cell
writer_orig = pd.ExcelWriter('db.xlsx', engine='xlsxwriter')
%time cds.to_excel(writer_orig, index=False, sheet_name='all')
writer_orig.save()
print('Exported to db.xlsx.')
from IPython.display import Javascript, display
from ipywidgets import widgets
def run_all(ev):
display(Javascript('IPython.notebook.execute_cells_below()'))
button = widgets.Button(description="Click here to update tables + charts:")
button.on_click(run_all)
display(button)
##module eff, FF, Voc, Jsc vs time
plt.figure(2)
plt.figure(figsize=(20,10))
plt.subplot(211)
plt.plot(ivtdfmod['Date_tm'], ivtdfmod['Efficiency']*100, '+')
plt.xlim([datetime.date(2016, 1, 1), datetime.date(2016, 6, 15)])
plt.ylim(8, 17)
#plt.title("6\" progress -- Eff")
#plt.xlabel('date')
plt.axhline(15.5, color='k', linestyle='--')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.ylabel('Module Efficiency')
#plt.show()
plt.subplot(212)
plt.plot(ivtdfmod['Date_tm'], ivtdfmod['FillFactor']*100, 'g+')
plt.xlim([datetime.date(2016, 1, 1), datetime.date(2016,6,15)])
plt.ylim(55, 80)
#plt.title("6\" progress -- FF")
#plt.xlabel('date')
plt.ylabel('FF')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.show()
plt.figure(3)
plt.figure(figsize=(20,15))
plt.subplot(311)
plt.plot(mod_trends['Date_tm'], mod_trends['modJsc'], 'r+')
plt.xlim([datetime.date(2016, 1, 1), datetime.date(2016,6,15)])
plt.ylim(20, 28)
#plt.title("6\" progress -- Jsc")
#plt.xlabel('date')
plt.ylabel('Jsc [mA/cm^2]')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
#plt.show()
plt.subplot(312)
plt.plot(mod_trends['Date_tm'], mod_trends['modVoc'], '+m')
plt.xlim([datetime.date(2016, 1, 1), datetime.date(2016,6,15)])
plt.ylim(0.78, .85)
#plt.title("6\" progress -- Voc")
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.xlabel('date')
plt.ylabel('Voc [V]')
plt.show()
ivtdfmod['Rsh_Ohm'] = ivtdfmod['Rsh_Ohm'].astype(float)
#ivtdfmod['mean_Rsh'] = ivtdfmod['Rsh_Ohm'].mean
#ivtdfmod['mean_Rsh']
plt.figure(3)
plt.figure(figsize=(20,15))
plt.subplot(311)
plt.plot(ivtdfmod['Date_tm'], ivtdfmod['Rs_Ohm']/22, 'k+')
plt.xlim([datetime.date(2016,1, 1), datetime.date(2016,6,15)])
plt.ylim(0, 6)
#plt.title("6\" progress -- Eff")
#plt.xlabel('date')
#plt.axhline(15.5, color='k', linestyle='--')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.ylabel('Rs/cell [Ohm]')
#plt.show()
plt.subplot(312)
plt.plot(ivtdfmod['Date_tm'], ivtdfmod['Rsh_Ohm']/22, 'y+')
plt.xlim([datetime.date(2016,1, 1), datetime.date(2016,6,15)])
plt.ylim(1e0, 1e8)
#plt.title("6\" progress -- Eff")
#plt.xlabel('date')
#plt.axhline(15.5, color='k', linestyle='--')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.ylabel('Rsh/cell [Ohm]')
plt.yscale('log')
plt.show()
import seaborn as sns
flatui = ["#3498db", "#e74c3c", "#2ecc71", "#95a5a6", "#34495e", "#9b59b6"]
sns.set(style='ticks')
sns.set_palette(flatui)
sns.set_context("notebook", font_scale=1.5,)
#fig, ax = plt.subplots(figsize=(15, 15))
# the size of A4 paper
#plt.figure(figsize=(20, 20))
#_cond = ['POR', 'EXP']
#trends['POR'] = trends['POR'].apply(str)
fg = sns.FacetGrid(mod_trends, hue='POR', size= 9, aspect=2.3)#, hue_kws=dict(marker=["^", "v"]))
fg.map(plt.scatter, 'Experiment_ID', 'percentEff', alpha=.7,)
plt.xlim(560,680)
plt.ylim(12, 17)
plt.axhline(15.5, color='k', linestyle='--')
plt.axhline(14.5, color='k', linestyle='--')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend()
fg1 = sns.FacetGrid(mod_trends, hue='POR', size= 9, aspect=2.3)
fg1.map(plt.scatter, 'Experiment_ID', 'percentFF', alpha=.7)
plt.xlim(560,680)
plt.ylim(50, 80)
#plt.axhline(15.5, color='k', linestyle='--')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend()
#g = sns.FacetGrid(tips, col="time", hue="smoker")
#>>> g = (g.map(plt.scatter, "total_bill", "tip", edgecolor="w")
#... .add_legend())
flatui = ["#3498db", "#e74c3c", "#2ecc71", "#95a5a6", "#34495e", "#9b59b6"]
sns.set(style='ticks')
sns.set_palette(flatui)
sns.set_context("notebook", font_scale=1.5,)
#fig, ax = plt.subplots(figsize=(15, 15))
# the size of A4 paper
#plt.figure(figsize=(20, 20))
#_cond = ['POR', 'EXP']
#trends['POR'] = trends['POR'].apply(str)
fg = sns.FacetGrid(cell_trends, hue='POR', size= 9, aspect=2.3)#, hue_kws=dict(marker=["^", "v"]))
fg.map(plt.scatter, 'Experiment_ID', 'percentEff', alpha=.7,)
plt.xlim(560,680)
plt.ylim(12, 17)
plt.axhline(15.5, color='k', linestyle='--')
plt.axhline(14.5, color='k', linestyle='--')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend()
fg1 = sns.FacetGrid(cell_trends, hue='POR', size= 9, aspect=2.3)
fg1.map(plt.scatter, 'Experiment_ID', 'percentFF', alpha=.7)
plt.xlim(560,680)
plt.ylim(50, 80)
#plt.axhline(15.5, color='k', linestyle='--')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend()
flatui = ["#3498db", "#e74c3c", "#2ecc71", "#95a5a6", "#34495e", "#9b59b6"]
sns.set(style='ticks')
sns.set_palette(flatui)
sns.set_context("notebook", font_scale=1.5,)
#fig, ax = plt.subplots(figsize=(15, 15))
# the size of A4 paper
# create our boxplot which is drawn on an Axes object
plt.figure(2, figsize=(20,12))
plt.subplot(211)
bplot = sns.boxplot('Experiment_ID', 'percentEff', hue='POR', data=cell_trends, notch=True)
# We can call all the methods avaiable to Axes objects
#bplot.set_title(title, fontsize=20)
#bplot.set_xlabel('Experiment ID', fontsize=16)
bplot.set_ylabel('cell efficiency [%]', fontsize=16)
bplot.tick_params(axis='y', labelsize=12, which='minor')
bplot.set_ylim(0,20)
bplot.set_xlim(355.5,405.5)
plt.xticks(rotation=30)
plt.legend()
plt.subplot(212)
bplot2 = sns.boxplot('Experiment_ID', 'percentFF', data=cell_trends, hue='POR', notch=True)
bplot2.set_xlabel('Experiment ID', fontsize=16)
bplot2.set_ylabel('cell FF [%]', fontsize=16)
bplot2.tick_params(axis='both', labelsize=12)
bplot2.set_ylim(50,80)
bplot2.set_xlim(355.5,405.5)
#sns.despine(left=True)
plt.xticks(rotation=30)
#plt.legend()
plt.show()
sns.set(style='ticks')
sns.set_context("poster")
flatui1 = ["#2ecc71", "#34495e", "#95a5a6", "#9b59b6", "#3498db", "#e74c3c",]
sns.set_palette(flatui1)
#fig, ax = plt.subplots(figsize=(15, 15))
# the size of A4 paper
#plt.figure(figsize=(20, 20))
fg = sns.FacetGrid(mod_trends, hue='POR', size=9, aspect=2.5)
fg.map(plt.scatter, 'Experiment_ID', 'modJsc', alpha=.7,)
plt.xlim(560,680)
#plt.xlim([datetime.date(2015, 12, 5), datetime.date(2016, 4, 25)])
plt.ylim(20, 29)
plt.axhline(15.5, color='k', linestyle='--')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend()
fg1 = sns.FacetGrid(mod_trends, hue='POR', size= 9, aspect=2.5)
fg1.map(plt.scatter, 'Experiment_ID', 'modVoc', alpha=.7, )
plt.xlim(560,680)
#plt.xlim([datetime.date(2015, 12, 5), datetime.date(2016, 4, 25)])
plt.ylim(.76, .86)
#plt.axhline(15.5, color='k', linestyle='--')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend()
sns.set(style='ticks')
flatui1 = ["#2ecc71", "#34495e", "#95a5a6", "#9b59b6", "#3498db", "#e74c3c",]
sns.set_palette(flatui1)
sns.set_context("notebook", font_scale=1.5,)
# create our boxplot which is drawn on an Axes object
plt.figure(2, figsize=(20,12))
plt.subplot(211)
bplot = sns.boxplot('Experiment_ID', 'cellJsc', hue='POR', data=cell_trends, notch=True)
# We can call all the methods avaiable to Axes objects
#bplot.set_title(title, fontsize=20)
#bplot.set_xlabel('Experiment ID', fontsize=16)
bplot.set_ylabel('Cell Jsc [$ma/cm^2$]', fontsize=16)
bplot.tick_params(axis='both', labelsize=12)
bplot.set_ylim(22,30)
bplot.set_xlim(355.5,405.5)
plt.xticks(rotation=30)
#bplot.legend()
plt.subplot(212)
bplot2 = sns.boxplot('Experiment_ID', 'cellVoc', data=cell_trends, hue='POR', notch=True)
bplot2.set_xlabel('Experiment ID', fontsize=16)
bplot2.set_ylabel('Cell Voc [V]', fontsize=16)
bplot2.tick_params(axis='both', labelsize=12)
bplot2.set_ylim(0.6,0.9)
bplot2.set_xlim(355.5,405.5)
#sns.despine(left=True)
plt.xticks(rotation=30)
plt.legend(loc='lower right')
plt.show()
#using extrapolated Rs+Rsh (Roc/Rsc) from LIV curves -- dark R can be found in Rs/Rsh but need to filter for dark
sns.set(style='ticks')
sns.set_context("poster")
flatui2 = ["#95a5a6", "#9b59b6","#2ecc71", "#34495e", "#3498db", "#e74c3c",]
sns.set_palette(flatui2)
#fig, ax = plt.subplots(figsize=(15, 15))
# the size of A4 paper
#plt.figure(figsize=(20, 20))
fg = sns.FacetGrid(mod_trends, hue='POR', size= 9, aspect=2.3)
fg.map(plt.scatter, 'Experiment_ID', 'modRs', alpha=.7,)
plt.xlim(560,680)
plt.ylim(.6, 4)
plt.axhline(15.5, color='k', linestyle='--')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend()
fg1 = sns.FacetGrid(mod_trends, hue='POR', size= 9, aspect=2.3)
fg1.map(plt.scatter, 'Experiment_ID', 'modRsh', alpha=.7,)
plt.xlim(560,680)
plt.ylim(1e1, 1e5)
plt.yscale('log')
#plt.axhline(15.5, color='k', linestyle='--')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend()
plt.savefig('shuntsbrah.png')
sns.set(style='ticks')
flatui2 = ["#95a5a6", "#9b59b6","#2ecc71", "#34495e", "#3498db", "#e74c3c",]
sns.set_palette(flatui2)
sns.set_context("notebook", font_scale=1.5,)
plt.rc('text', usetex=False)
# create our boxplot which is drawn on an Axes object
plt.figure(2, figsize=(20,12))
plt.subplot(211)
bplot = sns.boxplot('Experiment_ID', 'cellRs', hue='POR', data=cell_trends, notch=True)
# We can call all the methods avaiable to Axes objects
#bplot.set_title(title, fontsize=20)
#bplot.set_xlabel('Experiment ID', fontsize=16)
bplot.set_ylabel(r'Cell Rs [$\Omega$]', fontsize=16)
bplot.tick_params(axis='both', labelsize=12)
bplot.set_ylim(0.5,4.5)
bplot.set_xlim(355.5,405.5)
plt.xticks(rotation=30)
#plt.legend()
plt.subplot(212)
bplot2 = sns.boxplot('Experiment_ID', 'cellRsh', data=cell_trends, hue='POR', notch=True)
bplot2.set_xlabel('Experiment ID', fontsize=16)
bplot2.set_ylabel(r'Rsh [$\Omega$]', fontsize=16)
bplot2.tick_params(axis='both', labelsize=12)
bplot2.set_ylim(1,1e5)
bplot2.set_xlim(355.5,405.5)
plt.yscale('log')
#sns.despine(left=True)
plt.xticks(rotation=30)
plt.legend()
plt.show()
sns.set_context("notebook", font_scale=1.5,)
plt.figure(figsize=(20,12))
#plt.subplot(211)
#bplot = sns.boxplot('Experiment_ID', 'cellRs_norm', hue='POR', data=cell_trends, notch=True)
#bplot.set_ylabel(r'Cell Rs [$\Omega$]', fontsize=16)
#bplot.tick_params(axis='both', labelsize=12)
#bplot.set_ylim(-1.5,15.5)
#bplot.set_xlim(350.5,390.5)
#plt.xticks(rotation=30)
fg = sns.FacetGrid(cell_trends, hue='POR', size= 9, aspect=2.3)
fg.map(plt.scatter, 'Experiment_ID', 'cellRs_norm', alpha=.7,)
plt.xlim(560,680)
plt.ylim(0, 20)
plt.axhline(15.5, color='k', linestyle='--')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend()
fg1 = sns.FacetGrid(cell_trends, hue='POR', size= 9, aspect=2.3)
fg1.map(plt.scatter, 'Experiment_ID', 'cellRsh_norm', alpha=.7,)
plt.xlim(560,680)
plt.ylim(1e0, 1e8)
plt.yscale('log')
plt.axhline(15.5, color='k', linestyle='--')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend()
celltrendslatest = cell_trends[(cell_trends['Experiment_ID'] >= 623) & (cell_trends['Experiment_ID'] < 700)]
modtrendslatest = mod_trends[(mod_trends['Experiment_ID'] >= 623) & (mod_trends['Experiment_ID'] < 700)]
sns.set(style='ticks')
flatui2 = ["#95a5a6", "#9b59b6","#2ecc71", "#34495e", "#3498db", "#e74c3c",]
sns.set_palette(flatui2)
sns.set_context("notebook", font_scale=1.5,)
plt.figure(2, figsize=(12,10))
plt.subplot(211)
#v = sns.violinplot(x='Experiment_ID', y='cellRs', hue='POR', data=celltrendslatest, split=True, inner="quartile", bw=.5).set_ylim(-1, 10)
v = sns.violinplot(x='Experiment_ID', y='cellRs', hue='POR', data=celltrendslatest, split=True, inner="quartile", bw=.3).set_ylim(0, 20)
plt.xticks(rotation=30)
plt.subplot(212)
v2 = sns.violinplot(x='Experiment_ID', y='modRs', hue='POR', data=modtrendslatest, split=True, inner="quartile", bw=.3).set_ylim(0.4, 4)
plt.xticks(rotation=30)
#cds thickness vs efficiency
sns.set_palette("husl")
sns.set_context("notebook", font_scale=1.5,)
fg = sns.FacetGrid(cds, hue='Target Material', size= 9, aspect=2.4) #col='CdS Tool'
fg.map(plt.scatter, 'CdS Thickness (nm)', 'percentEff', alpha=.6,)
#plt.xlim(550,650)
plt.ylim(0, 17)
plt.axhline(15.5, color='k', linestyle='-')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend()
fg1 = sns.FacetGrid(cds, size= 9, aspect=2.4, hue='Current (mA)') #col='CdS Tool'
fg1.map(plt.scatter, 'CdTe Thickness in Angstroms', 'percentEff', alpha=.6,)
plt.xlim(15000,30000)
plt.ylim(0, 17)
plt.axhline(15.5, color='k', linestyle='-')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend()
colorb=['#66c2a5','#fc8d62','#8da0cb','#e78ac3','#a6d854','#ffd92f']
sns.set_palette("husl")
sns.set_context("notebook", font_scale=1.5,)
fg = sns.FacetGrid(cds, hue='Target Material', size= 9, aspect=2.4) #col='CdS Tool'
fg.map(plt.scatter, 'Date_tm', 'CdS Thickness (nm)', alpha=.6,)
#plt.xlim(550,650)
plt.xlim([datetime.date(2015, 7, 5), datetime.date(2016, 5, 25)])
plt.ylim(20, 100)
#plt.axhline(15.5, color='k', linestyle='-')
plt.title("CdS thickness")
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend(loc="lower right")
fg1 = sns.FacetGrid(cds, hue='Current (mA)', size= 9, aspect=2.4) #col='CdS Tool'
fg1.map(plt.scatter, 'Date_tm', 'CdTe Thickness in Angstroms', alpha=.6,)
#plt.xlim(550,650)
plt.xlim([datetime.date(2015, 7, 5), datetime.date(2016, 5, 25)])
plt.ylim(15000, 30000)
plt.title("CdTe thickness")
#plt.axhline(15.5, color='k', linestyle='-')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend(loc="upper left")
list(cds.columns.values)
fg1 = sns.FacetGrid(cds, size= 9, aspect=2.4, hue='CdTe_Tool') #col='CdS Tool'
fg1.map(plt.scatter,'Cd_Concentration','percentEff', alpha=.6,)
plt.xlim(50,54)
plt.ylim(10, 17)
#plt.axhline(15.5, color='k', linestyle='-')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend()
fg = sns.FacetGrid(cds, size= 9, aspect=2.4, hue='CdTe_Tool') #col='CdS Tool'
fg.map(plt.scatter,'Date_tm','Cd_Concentration', alpha=.6,)
#plt.xlim(50,54)
plt.xlim([datetime.date(2015, 12, 31), datetime.date(2016, 6, 25)])
plt.ylim(48, 54)
#plt.axhline(15.5, color='k', linestyle='-')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend()
fg2 = sns.FacetGrid(cds, size= 9, aspect=2.4, hue='CdTe_Tool') #col='CdS Tool'
fg2.map(plt.scatter,'Date_tm','Te_Concentration', alpha=.6,)
#plt.xlim(50,54)
plt.xlim([datetime.date(2015, 12, 31), datetime.date(2016, 6, 25)])
plt.ylim(46, 50)
#plt.axhline(15.5, color='k', linestyle='-')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend()
fg4 = sns.FacetGrid(cds, size= 9, aspect=2.4, hue='CdTe_Tool') #col='CdS Tool'
fg4.map(plt.scatter,'Cd_Concentration','Voc', alpha=.6,)
plt.xlim(50,54)
plt.ylim(0.7, 0.9)
#plt.axhline(15.5, color='k', linestyle='-')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend()
sns.color_palette("Paired")
sns.set_context("poster")
fg = sns.FacetGrid(cds, size= 6, aspect=1.5, col='CdTe_Tool', margin_titles=True, xlim=([datetime.date(2015, 7, 31), datetime.date(2016, 6, 25)]), ylim=(43, 58),hue='Cd_Concentration', palette = "coolwarm", legend_out=True) #col='CdS Tool'
plt.xticks(rotation=30)
fg.map(plt.scatter,'Date_tm', 'Cd_Concentration', alpha=.6,)
#plt.title("Cd Conc")
fg.set_xticklabels(rotation=30)
fg2 = sns.FacetGrid(cds, size= 6, aspect=1.5, margin_titles=True, xlim=([datetime.date(2015, 7, 31), datetime.date(2016, 6, 25)]), ylim=(43, 58),col='CdTe_Tool', hue='Te_Concentration', palette = "coolwarm", legend_out=True) #col='CdS Tool'
fg2.map(plt.scatter,'Date_tm', 'Te_Concentration', alpha=.6,)
#plt.title("Te Conc")
fg2.set_xticklabels(rotation=30)
cds.plot(kind='scatter', x='percentEff', y='Cd_Concentration');
plt.xlim(14,16.5)
plt.ylim(50,52)
sns.set_palette("husl")
sns.set_context("notebook", font_scale=1.5,)
fg = sns.FacetGrid(cds, hue='CdS Tool', size= 9, aspect=2.4)#, col='CdS Tool')
fg.map(plt.scatter, 'Date_tm', 'CdS Thickness (nm)', alpha=.6,)
#plt.xlim(550,650)
plt.xlim([datetime.date(2015, 7, 1), datetime.date(2016, 7, 1)])
plt.ylim(20, 100)
#plt.axhline(15.5, color='k', linestyle='-')
plt.title("CdS thickness by tool")
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend(loc="lower right")
fg1 = sns.FacetGrid(cds, hue='CdS Tool', size= 9, aspect=2.4)#, col='CdS Tool')
fg1.map(plt.scatter, 'CdS Thickness (nm)', 'percentEff',alpha=.6,)
plt.xlim(0,90)
#plt.xlim([datetime.date(2015, 7, 1), datetime.date(2016, 7, 1)])
plt.ylim(10, 20)
plt.axhline(15.5, color='k', linestyle='-')
plt.title("CdS thickness v eff")
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend(loc="best")
trends.describe()
#trends.sort_values(by='Date_tm')
#trends.iloc[:,[1,2,5,22,23,37, 38, 39]]
cds.describe()
#import seaborn as sns
sns.set(style="ticks", context="talk")
plt.figure(2, figsize=(12,10))
# Make a custom sequential palette using the cubehelix system
pal = sns.cubehelix_palette(4, 1.5, .75, light=.6, dark=.2)
# Plot tip as a function of toal bill across days
b = sns.lmplot(x='Experiment_ID', y='percentEff', col='POR', data=cell_trends,
palette=pal, size=7)
# Use more informative axis labels than are provided by default
b.set_axis_labels("Experiment ID", "Efficiency [%]")
plt.xlim(500,680)
plt.ylim(4, 18)
#dff.groupby('B').filter(lambda x: len(x['C']) > 2)
#groupedcells = cell_trends.groupby(['Experiment_ID', 'POR', 'Measurement']).filter(lambda x: )
#groupedcells = groupedcells.drop('Eff')
#del celldf
#del groupedcell
celldf = cell_trends.drop(['Eff', 'NumCells', 'FF', 'I0_nA', 'n', 'Pmp_fit_ratio'], axis=1)
celldf = celldf[~celldf['Measurement'].str.contains('.*Dark.*', na = False)]
celldf.head()
moddf = mod_trends.drop(['Eff', 'NumCells', 'FF', 'I0_nA', 'n', 'Pmp_fit_ratio'], axis=1)
moddf = moddf[~moddf['Measurement'].str.contains('.*Dark.*', na = False)]
moddf.head()
#setting up grouped median and mean dfs
groupmoddf = moddf.groupby('Experiment_ID', as_index=False)
modmedian = groupmoddf.median()
modmean = groupmoddf.mean()
groupcelldf = celldf.groupby('Experiment_ID', as_index=False)
cellmedian = groupcelldf.median()
cellmean = groupcelldf.mean()
list(cellmedian.columns.values)
cellmedian.tail(50)
#ax = df1.plot() method to plot 2 dfs on same plot
#df2.plot(ax=ax)
plt.figure(2, figsize=(15,10))
ax = cellmedian.plot( y=[15], label = 'median Eff')
cellmean.plot(ax=ax, y=[15], label = 'mean Eff' )
lines, labels = ax.get_legend_handles_labels()
ax.legend(lines[:2], labels[:2], loc='best')
plt.ylim(7,17)
plt.xlim(250, 420)
plt.figure(2, figsize=(14,8))
ax = modmedian.plot(kind='scatter', x=['Experiment_ID'], y=['percentEff'], label = 'mod med', color = 'DarkBlue', title = 'mod efficiencies')
modmean.plot(ax=ax, x=['Experiment_ID'], y=['percentEff'], label = 'mod mean', kind ='scatter', color = 'DarkGreen')
cellmedian.plot(ax=ax, kind='scatter', x=['Experiment_ID'], y=['percentEff'], label = 'cell med', color = 'LightBlue', title = 'efficiencies')
cellmean.plot(ax=ax, x=['Experiment_ID'], y=['percentEff'], label = 'cell mean', kind ='scatter', color = 'LightGreen')
lines, labels = ax.get_legend_handles_labels()
ax.legend(lines[:4], labels[:4], loc='upper right')
plt.ylim(8,18)
plt.xlim(560, 680)
#median = median.reset_index()
#mean = mean.reset_index()
plt.figure(figsize=(12,10))
ax = modmedian.plot(kind='scatter', x=['Experiment_ID'], y=['percentEff'], label = 'mod med', color = 'Red')
cellmedian.plot(ax=ax, kind='scatter', x=['Experiment_ID'], y=['percentEff'], label = 'cell med', color = 'LightBlue')
lines, labels = ax.get_legend_handles_labels()
plt.ylim(8,18)
plt.xlim(500, 680)
plt.title('efficiencies')
plt.figure(figsize=(12,10))
ax = modmean.plot(kind='scatter', x=['Experiment_ID'], y=['percentEff'], label = 'mod mean', color = 'Red')
cellmean.plot(ax=ax, kind='scatter', x=['Experiment_ID'], y=['percentEff'], label = 'cell mean', color = 'LightBlue')
lines, labels = ax.get_legend_handles_labels()
plt.ylim(8,18)
plt.xlim(500, 680)
plt.title('efficiencies')
allmed1 = pd.merge(modmedian, cellmedian, on='Experiment_ID')
allmed1['del_percentEff'] = allmed1['percentEff_x'] - allmed1['percentEff_y']
allmed1['del_percentFF'] = allmed1['percentFF_x'] - allmed1['percentFF_y']
plt.figure(2, figsize=(25,20))
ax = allmed1.plot(kind = 'scatter', x=['Experiment_ID'], y=['del_percentFF'], label = 'del FF mod-cell', color = 'DarkRed')
allmed1.plot(ax=ax, kind='scatter', x=['Experiment_ID'], y=['del_percentEff'], label = 'del eff mod-cell', color = 'LightBlue')
#allmed1.plot(ax=ax, kind='scatter', x=['Experiment_ID'], y=['del_voc'], label = 'del eff mod-cell med', color = 'LightBlue')
lines, labels = ax.get_legend_handles_labels()
plt.axhline(0, color='k', linestyle='--')
plt.axhline(-5, color='b', linestyle='--')
plt.axhline(-10, color='r', linestyle='--')
plt.ylim(-12,8)
plt.xlim(500, 680)
plt.title('median del')
#del allmed
#allmed = pd.merge(modmedian, cellmedian, on='Experiment_ID')
allmed = pd.concat([modmedian, cellmedian])
allmean1 = pd.merge(modmean, cellmean, on='Experiment_ID')
allmean1['del_percentEff'] = allmean1['percentEff_x'] - allmean1['percentEff_y']
allmean1['del_percentFF'] = allmean1['percentFF_x'] - allmean1['percentFF_y']
plt.figure(figsize=(20,20))
ax = allmean1.plot(kind = 'scatter', x=['Experiment_ID'], y=['del_percentFF'], label = 'del FF mod-cell', color = 'DarkRed')
allmean1.plot(ax=ax, kind='scatter', x=['Experiment_ID'], y=['del_percentEff'], label = 'del eff mod-cell mean', color = 'LightBlue')
#allmed1.plot(ax=ax, kind='scatter', x=['Experiment_ID'], y=['del_voc'], label = 'del eff mod-cell med', color = 'LightBlue')
lines, labels = ax.get_legend_handles_labels()
plt.axhline(0, color='k', linestyle='--')
plt.axhline(-5, color='b', linestyle='--')
plt.axhline(-10, color='r', linestyle='--')
plt.ylim(-4,4)
plt.xlim(500, 680)
plt.title('mean del')
allmed1['del_voc'] = allmed1['modVoc'] - allmed1['cellVoc']
allmed1['del_jsc'] = allmed1['modJsc'] - allmed1['cellJsc']
plt.figure(figsize=(18,10))
ax = allmed1.plot(kind = 'scatter', x=['Experiment_ID'], y=['del_jsc'], label = 'jsc', color = 'Red')
allmed1.plot(ax=ax, kind='scatter', x=['Experiment_ID'], y=['del_voc'], label = 'voc', color = 'Green')
lines, labels = ax.get_legend_handles_labels()
plt.axhline(0, color='k', linestyle='--')
plt.axhline(-1, color='b', linestyle='--')
plt.axhline(-2, color='r', linestyle='--')
plt.ylim(-1,0.5)
plt.xlim(600, 680)
plt.title('dels')
sns.set(style='ticks')
sns.set_context("poster")
flatui1 = ["#2ecc71", "#34495e", "#95a5a6", "#9b59b6", "#3498db", "#e74c3c",]
sns.set_palette(flatui1)
#fig, ax = plt.subplots(figsize=(15, 15))
# the size of A4 paper
#plt.figure(figsize=(20, 20))
fg = sns.FacetGrid(allmed, hue='Cell_Count', size= 9, aspect=2.3,despine=False)#, hue_kws=dict(marker=["^", "v"]))
fg.map(plt.scatter, 'Experiment_ID', 'percentEff', alpha=.7,)
plt.xlim(250,680)
plt.ylim(6, 18)
#plt.axhline(15.5, color='k', linestyle='--')
#plt.axhline(14.5, color='k', linestyle='--')
plt.grid(b=True, which='both', color='0.65',linestyle='-')
plt.legend()
#del groupedcells
celltrendstrimmed = cell_trends[(cell_trends['Experiment_ID'] >= 400) & (cell_trends['Experiment_ID'] < 700)]
groupedcells = celltrendstrimmed.groupby(['Experiment_ID', 'POR'],as_index=False)
groupedmean = groupedcells.aggregate(np.mean)
#groupedmean = groupedmean.reset_index()
#groupedmean
#groupedmean.info()
#print(groupedmean.columns)
sns.set_context("notebook")
plt.figure(figsize=(10, 10))
p = sns.lmplot(x="Experiment_ID", y="percentEff", data=groupedmean, col ="POR", size=8)
plt.ylim(6,18)
b = pd.DataFrame(mod_trends.groupby(['Experiment_ID'], as_index=False)['shunt_count'].sum())
b.sort_values(by='Experiment_ID')
b.head()
plt.figure(figsize=(15, 8))
sns.barplot(x='Experiment_ID', y='shunt_count', data=b)
plt.xlim(200.5, 405.5)
plt.ylim(0,30)
plt.xticks(rotation=30)
plt.figure(figsize=(15, 8))
b.plot(x='Experiment_ID', y='shunt_count', kind='bar')
plt.xlim(350.5, 405.5)
plt.ylim(0,40)
b1 = pd.DataFrame(cell_trends.groupby(['Experiment_ID'], as_index=False)['shunt_count'].sum())
b1.sort_values(by='Experiment_ID')
b1.head()
plt.figure(figsize=(15, 8))
sns.barplot(x='Experiment_ID', y='shunt_count', data=b1)
plt.axhline(7*20, color='k', linestyle='--')
plt.xlim(330.5, 405.5)
plt.ylim(0,400)
plt.xticks(rotation=30)
#b1.plot(x='Experiment_ID', y='shunt_count', kind='bar')
plt.figure(figsize=(15, 8))
sns.barplot(x='Experiment_ID', y='shunt_count', data=b1)
plt.axhline(7*20, color='k', linestyle='--')
plt.xlim(200.5, 400.5)
plt.ylim(0,400)
#del groupedcells
#del groupedcells1
groupedcells = cell_trends.groupby(['Experiment_ID', 'POR'], as_index=False )
groupedcells = groupedcells.describe().unstack()
groupedcells1 = groupedcells.reset_index()
groupedcells1.head()
ma = Series.rolling(celldf.percentEff, center=False,window=30).mean()
mstd = pd.rolling_std(celldf.percentEff, 30)
plt.figure()
plt.plot(celldf.index, celldf.percentEff, 'k')
plt.plot(ma.index, ma, 'b')
plt.fill_between(mstd.index, ma-2*mstd, ma+2*mstd, color='b', alpha=0.2)
plt.xlim(500,660)
plt.ylim(0,25)